<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录</title>
</head>
<body>

<%

String name=new String(request.getParameter("user").getBytes("ISO-8859-1"),"utf-8");
String password=request.getParameter("password");
if("黄彪".equals(name)&&"12".equals(password)){
	//java代码嵌入js代码
	//out.print("<script type='text/javascript'>alert('登录成功');</script>");
	
	response.sendRedirect("succeed.jsp");//信息正确时利用响应response对象进行重定向
	}else{
		response.sendRedirect("loser.jsp");//信息错误时利用响应response对象进行重定向
	}

%>
<%=name %>
<%=password %>
</body>
</html>